package tio.client;


import org.tio.client.ClientChannelContext;
import org.tio.client.ClientGroupContext;
import org.tio.client.TioClient;
import org.tio.core.Node;
import org.tio.core.Tio;

/**
 * Hello world!
 *
 */
public class App
{
    public static void main( String[] args ) throws Exception {

        ClientGroupContext clientGroupContext = new ClientGroupContext(new MClientAioHander(), new MClientAioListener());

        TioClient tioClient = new TioClient(clientGroupContext);

        ClientChannelContext clientChannelContext = tioClient.connect(new Node("121.40.35.114", 9092));

        ClientPacket clientPacket = new ClientPacket();
        clientPacket.setBody("hello,t-tio".getBytes("utf-8"));

        Tio.send(clientChannelContext, clientPacket);
    }
}